<form cam-form role="form" name="form">

  <input cam-variable-name="stringVar"
    cam-variable-type="String"
    type="text"
    name="stringVar"
    ng-model="modelProperty"
    min-length="5"
    max-length="10">

  <input cam-variable-name="autoBindVar"
    cam-variable-type="String"
    type="text">

  <p>
  {{modelProperty}}
  </p>

  <input cam-variable-name="integerVar"
    cam-variable-type="Integer"
    type="text"
    name="integerVar"
    ng-model="integerProperty">

  <script cam-script type="text/form-script">

    // scope must be defined
    if(typeof $scope !== 'object') {
      throw Error('Expecting "$scope" to be defined');
    }

    // inject must be available
    if(typeof inject !== 'function') {
      throw Error('Expecting "inject" to be defined');
    }

    camForm.on('variables-applied', function() {
      if(!$scope.modelProperty) {
        throw Error('Expecting "$scope.modelProperty" to be defined');
      }
    });

  </script>

</form>

